prices <- tq_get(params$symbol, "stock.prices") %>%
filter_by_time(date, params$startdate, params$enddate)
close <- Cl(last(prices))
open <- Op(last(prices))
raw_fname <- paste0(params$symbol, "_", Sys.Date(), ".csv")
write.csv(prices, raw_fname)
rmarkdown::output_metadata$set(rsc_output_files = list(raw_fname))
The stock MSFT closed up at $157.7 per share yesterday.
This report contains data from 2015-01-01 to 2019-12-31
The chart below is made with the timetk R package, which helps easily draw great-looking static (ggplot2) and interactive (plotly) time series charts.
plot_time_series(prices, date, adjusted,
.title = paste0("Adjusted closing price for ", params$symbol),
.plotly_slider = TRUE)
The table below displays the daily price data for MSFT between 2015-01-01 and 2019-12-31. A concise, interactive table is created with the reactable package.
reactable(prices,
resizable = TRUE,
filterable = TRUE,
searchable = TRUE)